import { _decorator, Collider2D, Component, Node } from 'cc';
import { GameManager, GameState } from '../GameManager';
const { ccclass, property } = _decorator;

@ccclass('Bullet_Player_0')
export class Bullet_Player_0 extends Component {

    @property(Node)
    bullet_0:Node=null;
    
    @property
    bullet_0_Speed:number=300;
    
    collider: Collider2D = null;

    start() {

    }

    update(deltaTime: number) {
        if (GameManager.getInstance().gameState == GameState.START){
                
            const newPos=this.bullet_0.getPosition();
            newPos.y+=this.bullet_0_Speed*deltaTime;
            this.bullet_0.setPosition(newPos);
        }
    }
}


